SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




ALTER     VIEW dbo.v_td_depotkind
AS
SELECT dk.*, k.kname
  ,isb.subcode+':'+isb.subname isubidname
  ,csb.subcode+':'+csb.subname csubidname
  ,ssb.subcode+':'+ssb.subname ssubidname
  ,rsb.subcode+':'+rsb.subname rsubidname
  ,asb.subcode+':'+asb.subname asubidname
  ,gsb.subcode+':'+gsb.subname gsubidname
  ,lsb.subcode+':'+lsb.subname lsubidname
  ,vsb.subcode+':'+vsb.subname vsubidname
FROM dbo.td_depotkind dk 
  LEFT JOIN dbo.ts_kind k ON dk.kind = k.kid
  Left join tfd_subject isb on isubid=isb.subjectid
  left join tfd_subject csb on csubid=csb.subjectid
  left join tfd_subject ssb on ssubid=ssb.subjectid
  left join tfd_subject rsb on rsubid=rsb.subjectid
  left join tfd_subject asb on asubid=asb.subjectid
  left join tfd_subject gsb on gsubid=gsb.subjectid
  left join tfd_subject lsb on lsubid=lsb.subjectid
  left join tfd_subject vsb on vsubid=vsb.subjectid
WHERE (k.kind = 5104)



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

